//
//  HHDiagramView.swift
//  HHSwiftuiPractice
//
//  Created by YL-Hong on 2023/9/25.
//图形

import SwiftUI

struct HHDiagramView: View {
    var body: some View {
        Circle() //圆
            .stroke(Color.orange,style: StrokeStyle(lineWidth: 20, lineCap: .round, dash: [30]))
            .frame(width: 200,height: 200)
            
        Ellipse() //椭圆
            .foregroundColor(.red) //颜色
            .frame(width: 200,height: 300)
            
        Rectangle()
            .stroke(Color.accentColor,lineWidth: 10)
            .frame(width: 100, height: 200) //矩形
           
        RoundedRectangle(cornerRadius: 20) //圆角矩形
            .frame(width: 100,height: 200)
        
        Capsule() //胶囊
            .trim(from: 0.0, to: 0.6) //切割
            .frame(width: 300)
    }
}

struct HHDiagramView_Previews: PreviewProvider {
    static var previews: some View {
        HHDiagramView()
    }
}
